package com.example.lab3.infra.repository.impl;

import com.example.lab3.api.dto.EmployeeDTO;
import com.example.lab3.domain.entity.Employee;
import com.example.lab3.domain.repository.EmployeeRepository;
import com.example.lab3.infra.mapper.EmployeeMapper;
import org.springframework.stereotype.Component;

import java.util.List;


@Component
public class EmployeeRepositoryImpl implements EmployeeRepository {

    private final EmployeeMapper employeeMapper;

    public EmployeeRepositoryImpl(EmployeeMapper employeeMapper) {
        this.employeeMapper = employeeMapper;
    }

    @Override
    public List<Employee> findEmployeeByCondition(Employee employee) {
        return employeeMapper.findEmployeeByCondition(employee);
    }

    @Override
    public Employee findEmployeeById(Integer employeeId) {
        return employeeMapper.findEmployeeById(employeeId);
    }

    @Override
    public Employee getEmployeeWithLeader(EmployeeDTO employeeDTO) {
        return employeeMapper.getEmployeeWithLeader(employeeDTO);
    }

    @Override
    public List<Employee> getEmployeeList(EmployeeDTO employeeDTO) {
        return employeeMapper.getEmployeeList(employeeDTO);
    }

    @Override
    public void updateEmployee(EmployeeDTO employeeDTO) {
        employeeMapper.updateEmployee(employeeDTO);
    }

    @Override
    public void insertEmployee(EmployeeDTO employeeDTO) {
        employeeMapper.insertEmployee(employeeDTO);
    }
}
